import { eMenuType } from '@/interface/enum';
import { RouteRecordRaw } from 'vue-router';
import { iRouteMeta } from '@/interface/iRouteInfo';
import { getMenuImageUrl } from '@/utils/ui';

const controllerStatusMeta: iRouteMeta = {
    menu_show: true,
    menu_type: eMenuType.MENU,
    normal: getMenuImageUrl('data_report.png'),
    // hover: getMenuImageUrl('room_hover.png'),
    parentPath: '',
    sort: 1,
    title: '数据报表',
    elements: [
        // {
        //   key: 'online_pay_refund',
        //   title: '退款功能',
        //   local_path: RouterConfig.Main.fullPath,
        //   menu_type: eMenuType.ELEMENT,
        // },
    ],
};

export const data_report: RouteRecordRaw = {
    name: 'data_report',
    path: '/data_report',
    meta: controllerStatusMeta,
    redirect: '/data_report/today',
    component: () => import('@/layout/ContentLayout.vue'),
    children: [
        {
            path: '/data_report/today',
            name: 'data_report_today',
            meta: {
                menu_show: true,
                menu_type: eMenuType.PAGE,
                title: '分析数据',
                parentPath: '/data_report',
                sort: 1,
            },
            component: () => import('@/views/data_report/today/index.vue'),
            children: [
                // {
                //   path: '/data_report/history',
                //   name: 'data_report_history',
                //   meta: {
                //     menu_show: true,
                //     menu_type: eMenuType.PAGE,
                //     title: '历史记录',
                //     parentPath: '/data_report',
                //     sort: 1,
                //   },
                //   component: () => import('@/views/data_report/history/index.vue'),
                // },
            ],
        },
        {
            path: '/data_report/today/history_c',
            name: 'data_report_history',
            redirect: '/data_report/today/history_c/detail',
            meta: {
                menu_show: false,
                menu_type: eMenuType.PAGE,
                title: '分析数据',
                parentPath: '/data_report',
                sort: 1,
            },
            component: () => import('@/views/data_report/index.vue'),
            children: [
                {
                    path: '/data_report/today/history_c/detail',
                    name: 'data_report_history_id',
                    meta: {
                        menu_show: false,
                        menu_type: eMenuType.PAGE,
                        title: '历史记录',
                        parentPath: '/data_report',
                        sort: 1,
                    },
                    component: () => import('@/views/data_report/history/index.vue'),
                },
            ],
        },
        //新页面开发中
        {
            path: '/data_report/realtime',
            name: 'data_report_realtime',
            // redirect: '/data_report/realtime',
            meta: {
                menu_show: true,
                menu_type: eMenuType.PAGE,
                title: '实时数据',
                parentPath: '/data_report',
                sort: 1,
            },
            component: () => import('@/views/data_report/realtime/index.vue'),
            children: [
                // {
                //     path: '/data_report/today/realtime/detail',
                //     name: 'data_report_realtime_detail',
                //     meta: {
                //         menu_show: true,
                //         menu_type: eMenuType.PAGE,
                //         title: '实时数据',
                //         parentPath: '/data_report',
                //         sort: 1,
                //     },
                //     component: () => import('@/views/data_report/realtime/index.vue'),
                // },
            ],
        },
    ],
};
